<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>slot-编译作用域</title>
</head>

<body>
    <div id="app">
        <cpn v-show=isShow></cpn><!-- 使用的是实例里面的isShow -->
    </div>
    <template id="cpn">
        <div>
            <h2>我是子组件</h2>
            <h2 v-show=isShow>我是子组件内容</h2><!-- 使用的是子组件里面的isShow -->
        </div>
    </template> 
    <script src="./js/vue.min.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                message: 'hello',
                isShow:true
            },
            components: {
                cpn: {
                    template: '#cpn'
                },
                data(){
                    return{
                        isShow:false,
                    }
                }
            }
        })
    </script>
</body>

</html>